home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 August
/
Macworld (1997-08).dmg
/
Shareware World
/
Info
/
For Developers
/
SC Basic
/
Example Programs
/
Dos To Mac
/
DosToMac.bas
< prev
next >
Wrap
BASIC Source File
|
1997-06-17
|
2KB
|
90 lines
Global FSSpec1 As Structure
Global vRefNum1 As Word
Global parID1 As Integer
Global name1 As Str255[63]
Endstruct
Global FSSpec2 As Structure
Global vRefNum2 As Word
Global parID2 As Integer
Global name2 As Str255[63]
Endstruct
Do Display_File_Select_Boxes
Do Initialise
Do Process_Files
Do Cleanup
End
*********************************************************
* *
* Display File Select Boxes *
*********************************************************
Procedure Display_File_Select_Boxes()
Local Reply As Structure
Local sfGood As Byte
Local sfReplacing As Byte
Local sfType As Integer
Local sfFile As Char[70]
Local sfScript As Word
Local sfFlags As Word
Local sfIsFolder As Byte
Local sfIsVolume As Byte
Local sfReserved1 As Integer
Local sfReserved2 As Word
Endstruct
_StandardGetFile(0,Word(1),Char("TEXT"),Reply)
If Integer(sfGood)=0
End
Else
FSSpec1=sfFile
Endif
_StandardPutFile(Str255("Name of file to save"),Str255("Mac.out"),Reply)
If Integer(sfGood)=0
End
Else
FSSpec2=sfFile
Endif
Return
*********************************************************
* *
* Initialise *
*********************************************************
Procedure Initialise()
FSOpen FSSpec1 For Input As #1
FSOpen FSSpec2 For Output As #2
Return
*********************************************************
* *
* Process Files *
*********************************************************
Procedure Process_Files()
Local TempString As String [255]
Local FirstChar As Integer
Repeat
Line Input #1,TempString
FirstChar=Asc(Left(TempString,1))
If FirstChar=10 ' Line Feed
TempString=Right(TempString,Len(TempString)-1)
Endif
Print #2,TempString
Until Eof(1)
Return
*********************************************************
* *
* Cleanup *
*********************************************************
Procedure Cleanup()
Close #1
Close #2
Return